GCC=g++
GCC_FLAGS=-Ilib -Wall -O3

#Name of the files that are part of the project
MAIN_FILE=clustrophobia

FILES=\
    state \
    clustering_instance \
    meta_heuristics \
    utils 

#The next variables hold the dependencies of each file
#DEP_example=dep1 dep2 dep3
DEP_meta_heuristics=state utils
DEP_state=clustering_instance utils



#Rule for compiling the main file
$(MAIN_FILE): src/$(MAIN_FILE).cpp $(FILES:%=bin/%.o)
	$(GCC) $(GCC_FLAGS) -o bin/$(MAIN_FILE) src/$(MAIN_FILE).cpp $(FILES:%=bin/%.o)
	
#General rule for compiling
bin/%.o: src/%.cpp lib/%.h
	$(GCC) $(GCC_FLAGS) -c $< -o $@

#Dependencies:
#bin/example.o: $(DEP_example:%=src/%.cpp) $(DEP_example:%=lib/%.h)
bin/meta_heuristics.o: $(DEP_meta_heuristics:%=src/%.cpp) $(DEP_meta_heuristics:%=lib/%.h)
bin/state.o: $(DEP_state:%=src/%.cpp) $(DEP_state:%=lib/%.h)

doc:
	doxygen doc/Doxyfile
        
clean:
	rm -f bin/*.o bin/$(MAIN_FILE) 

cleandoc:
	rm -rf doc/html
